import Vue from "vue";
import VueRouter from "vue-router";
import HomeView from "../views/HomeView";
import SiftView from "../views/SiftView";
import ShoppingCarView from "../views/ShoppingCarView";
import UserView from "../views/UserView";
import ClassifyDetail from "../views/ClassifyDetailView";
import GoodsDetail from "../views/GoodsDetail";
Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "home",
    component: HomeView,
  },
  {
    path: "/sift",
    component: SiftView,
  },
  {
    path: "/shoppingcar",
    component: ShoppingCarView,
  },
  {
    path: "/user",
    name: "user",
    component: UserView,
  },
  {
    path: "/detail/:id",
    component: ClassifyDetail,
  },
  {
    path: "/goodsdetail/:id",
    component: GoodsDetail,
  },
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});

export default router;
